package com.blank.black.enums;

public enum JoinModeEnum {
    /**
     * 0:无；1：left;2:right;3:inner;
     */
    NULL(0, ""),
    LEFT(1, "left"),
    RIGHT(2, "right"),
    INNER(3, "inner"),
    ;

    private Integer code;

    private String name;

    JoinModeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getModeName(Integer code) {
        JoinModeEnum[] values = JoinModeEnum.values();
        for (JoinModeEnum item : values) {
            if (code.equals(item.getCode())) {
                return item.getName();
            }
        }
        return NULL.getName();
    }

}
